import Vue from "vue";
import App from "./App";
import {
	router,
	RouterMount
} from "@/common/router";
import store from "@/common/store";
import uView from "@/uview-ui";
import common from "@/common";
import httpInterceptor from '@/common/request/http.interceptor.js'

async function bootstrap() {
	App.mpType = "app";
	//引入路由
	Vue.use(router);
	// 引入全局uView
	Vue.use(uView);
	//加载common
	Vue.use(common);

	const app = new Vue({
		store,
		...App
	});



// http拦截器，将此部分放在new Vue()和app.$mount()之间，才能App.vue中正常使用
Vue.use(httpInterceptor, app)

	// #ifdef H5
	RouterMount(app, router, "#app");
	// #endif
	// #ifndef H5
	app.$mount();
	// #endif
}

bootstrap();
